export default {
  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    // title: '',
    htmlAttrs: {
      lang: 'en',
    },
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' },
      { name: 'format-detection', content: 'telephone=no' },
    ],
    link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: ['ant-design-vue/dist/antd.css', '~/assets/styles/css/normailze.css'],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [
    '@/plugins/antd-ui',
    '~/plugins/router',
    // {
    //   src: '~/plugins/gsap.js',
    //   mode: 'client',
    // },
    { src: '~/plugins/aos.js', ssr: false }, //只在客户端渲染
  ],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [
    // https://go.nuxtjs.dev/eslint
    '@nuxtjs/eslint-module',
    '@nuxtjs/router',
    '@nuxtjs/tailwindcss',
  ],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
    '@nuxtjs/router',
    'cookie-universal-nuxt',
    '@nuxtjs/axios',
    '@nuxtjs/proxy',
    '@nuxtjs/style-resources',
  ],
  axios: {
    //是否启用代理
    proxy: true,
    baseUrl: 'http://testapi.xuexiluxian.cn/api',
    retry: { retries: 3 },
  },

  proxy: {
    '/api': {
      target: 'http://testapi.xuexiluxian.cn',
      changeOrigin: true,
      pathRewrite: { '^/api': '' },
    },
  },
  server: {
    port: 2350,
    host: '0.0.0.0',
    timing: false,
  },

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    transpile: ['ant-design-vue'],
  },

  // Build Configuration: https://go.nuxtjs.dev/config-build
  router: {
    middleware: 'auth',
  },

  styleResources: {
    scss: [
      '~/assets/styles/scss/variables.scss',
      '~/assets/styles/scss/mixins.scss',
    ],
  },

  tailwindcss: {
    cssPath: '~/assets/styles/css/tailwind.css',
    configPath: 'tailwind.config.js',
    exposeConfig: false,
    config: {},
  },
}
